home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / ICPAppSource+ICprogKit / ICAppSourceKit 1.3.sit / ICAppSourceKit1.3 / RequiredEventSupport.p < prev    next >
MacBinary  |  1995-11-04  |  4.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: RequiredEventSupport.p

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Applause Picture (image/applausePicture) ext Unsupported
1% dexvert bsdiff patch (other/bsdiffPatch) ext Unsupported
1% dexvert imgdiff patch (other/imgdiffPatch) ext Unsupported
1% dexvert MATLAB p-code (other/matlabPCode) ext Unsupported
1% dexvert WSUS Patch Storage File (other/wsusPatchStorageFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Nov 4 13:03:25 1995, modified Sat Nov 4 13:03:25 1995, creator 'CWIE', type ASCII, 4058 bytes "RequiredEventSupport.p" , at 0x105a 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 16 52 65 71 75 69 72 | 65 64 45 76 65 6e 74 53 |..Requir|edEventS|
|00000010| 75 70 70 6f 72 74 2e 70 | 00 00 00 00 00 00 00 00 |upport.p|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 0f da 00 | 00 01 9a ac c1 5b 6d ac |........|.....[m.|
|00000060| c1 5b 6d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.[m.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 02 ef 00 00 |........|........|
|00000080| 75 6e 69 74 20 52 65 71 | 75 69 72 65 64 45 76 65 |unit Req|uiredEve|
|00000090| 6e 74 53 75 70 70 6f 72 | 74 3b 0d 0d 69 6e 74 65 |ntSuppor|t;..inte|
|000000a0| 72 66 61 63 65 0d 0d 09 | 75 73 65 73 0d 09 09 41 |rface...|uses...A|
|000000b0| 70 70 6c 65 45 76 65 6e | 74 73 3b 0d 0d 09 66 75 |ppleEven|ts;...fu|
|000000c0| 6e 63 74 69 6f 6e 20 49 | 6e 69 74 41 70 70 6c 65 |nction I|nitApple|
|000000d0| 45 76 65 6e 74 73 20 28 | 44 6f 4f 41 70 70 2c 20 |Events (|DoOApp, |
|000000e0| 44 6f 4f 44 6f 63 2c 20 | 44 6f 50 72 69 6e 74 2c |DoODoc, |DoPrint,|
|000000f0| 20 44 6f 51 75 69 74 3a | 20 50 74 72 29 3a 20 4f | DoQuit:| Ptr): O|
|00000100| 53 45 72 72 3b 0d 09 66 | 75 6e 63 74 69 6f 6e 20 |SErr;..f|unction |
|00000110| 47 6f 74 52 65 71 75 69 | 72 65 64 50 61 72 61 6d |GotRequi|redParam|
|00000120| 73 20 28 74 68 65 41 70 | 70 6c 65 45 76 65 6e 74 |s (theAp|pleEvent|
|00000130| 3a 20 41 70 70 6c 65 45 | 76 65 6e 74 29 3a 20 4f |: AppleE|vent): O|
|00000140| 53 45 72 72 3b 0d 0d 69 | 6d 70 6c 65 6d 65 6e 74 |SErr;..i|mplement|
|00000150| 61 74 69 6f 6e 0d 0d 09 | 66 75 6e 63 74 69 6f 6e |ation...|function|
|00000160| 20 44 6f 4f 41 70 70 20 | 28 70 3a 20 70 74 72 29 | DoOApp |(p: ptr)|
|00000170| 3a 20 4f 53 45 72 72 3b | 0d 09 69 6e 6c 69 6e 65 |: OSErr;|..inline|
|00000180| 0d 09 09 24 32 30 35 46 | 2c 20 28 2a 20 6d 6f 76 |...$205F|, (* mov|
|00000190| 65 61 2e 6c 09 28 61 37 | 29 2b 2c 61 30 09 09 3b |ea.l.(a7|)+,a0..;|
|000001a0| 20 70 6f 70 20 70 72 6f | 63 2f 66 75 6e 63 20 61 | pop pro|c/func a|
|000001b0| 64 64 72 65 73 73 09 2a | 29 0d 09 09 24 34 45 39 |ddress.*|)...$4E9|
|000001c0| 30 3b 20 28 2a 20 6a 73 | 72 09 09 09 28 61 30 29 |0; (* js|r...(a0)|
|000001d0| 09 09 09 09 3b 20 63 61 | 6c 6c 20 70 72 6f 63 2f |....; ca|ll proc/|
|000001e0| 66 75 6e 63 09 09 09 09 | 2a 29 0d 0d 09 66 75 6e |func....|*)...fun|
|000001f0| 63 74 69 6f 6e 20 44 6f | 44 6f 63 73 20 28 66 73 |ction Do|Docs (fs|
|00000200| 3a 20 46 53 53 70 65 63 | 3b 20 70 3a 20 70 74 72 |: FSSpec|; p: ptr|
|00000210| 29 3a 20 4f 53 45 72 72 | 3b 0d 09 69 6e 6c 69 6e |): OSErr|;..inlin|
|00000220| 65 0d 09 09 24 32 30 35 | 46 2c 20 28 2a 20 6d 6f |e...$205|F, (* mo|
|00000230| 76 65 61 2e 6c 09 28 61 | 37 29 2b 2c 61 30 09 09 |vea.l.(a|7)+,a0..|
|00000240| 3b 20 70 6f 70 20 70 72 | 6f 63 2f 66 75 6e 63 20 |; pop pr|oc/func |
|00000250| 61 64 64 72 65 73 73 09 | 2a 29 0d 09 09 24 34 45 |address.|*)...$4E|
|00000260| 39 30 3b 20 28 2a 20 6a | 73 72 09 09 09 28 61 30 |90; (* j|sr...(a0|
|00000270| 29 09 09 09 09 3b 20 63 | 61 6c 6c 20 70 72 6f 63 |)....; c|all proc|
|00000280| 2f 66 75 6e 63 09 09 09 | 09 2a 29 0d 0d 09 66 75 |/func...|.*)...fu|
|00000290| 6e 63 74 69 6f 6e 20 44 | 6f 51 75 69 74 20 28 70 |nction D|oQuit (p|
|000002a0| 3a 20 70 74 72 29 3a 20 | 4f 53 45 72 72 3b 0d 09 |: ptr): |OSErr;..|
|000002b0| 69 6e 6c 69 6e 65 0d 09 | 09 24 32 30 35 46 2c 20 |inline..|.$205F, |
|000002c0| 28 2a 20 6d 6f 76 65 61 | 2e 6c 09 28 61 37 29 2b |(* movea|.l.(a7)+|
|000002d0| 2c 61 30 09 09 3b 20 70 | 6f 70 20 70 72 6f 63 2f |,a0..; p|op proc/|
|000002e0| 66 75 6e 63 20 61 64 64 | 72 65 73 73 09 2a 29 0d |func add|ress.*).|
|000002f0| 09 09 24 34 45 39 30 3b | 20 28 2a 20 6a 73 72 09 |..$4E90;| (* jsr.|
|00000300| 09 09 28 61 30 29 09 09 | 09 09 3b 20 63 61 6c 6c |..(a0)..|..; call|
|00000310| 20 70 72 6f 63 2f 66 75 | 6e 63 09 09 09 09 2a 29 | proc/fu|nc....*)|
|00000320| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 47 6f 74 52 |...funct|ion GotR|
|00000330| 65 71 75 69 72 65 64 50 | 61 72 61 6d 73 20 28 74 |equiredP|arams (t|
|00000340| 68 65 41 70 70 6c 65 45 | 76 65 6e 74 3a 20 41 70 |heAppleE|vent: Ap|
|00000350| 70 6c 65 45 76 65 6e 74 | 29 3a 20 4f 53 45 72 72 |pleEvent|): OSErr|
|00000360| 3b 0d 09 09 76 61 72 0d | 09 09 09 74 79 70 65 43 |;...var.|...typeC|
|00000370| 6f 64 65 3a 20 44 65 73 | 63 54 79 70 65 3b 0d 09 |ode: Des|cType;..|
|00000380| 09 09 61 63 74 75 61 6c | 53 69 7a 65 3a 20 53 69 |..actual|Size: Si|
|00000390| 7a 65 3b 0d 09 09 09 65 | 72 72 3a 20 4f 53 45 72 |ze;....e|rr: OSEr|
|000003a0| 72 3b 0d 09 62 65 67 69 | 6e 0d 09 09 65 72 72 20 |r;..begi|n...err |
|000003b0| 3a 3d 20 41 45 47 65 74 | 41 74 74 72 69 62 75 74 |:= AEGet|Attribut|
|000003c0| 65 50 74 72 28 74 68 65 | 41 70 70 6c 65 45 76 65 |ePtr(the|AppleEve|
|000003d0| 6e 74 2c 20 6b 65 79 4d | 69 73 73 65 64 4b 65 79 |nt, keyM|issedKey|
|000003e0| 77 6f 72 64 41 74 74 72 | 2c 20 74 79 70 65 57 69 |wordAttr|, typeWi|
|000003f0| 6c 64 43 61 72 64 2c 20 | 74 79 70 65 43 6f 64 65 |ldCard, |typeCode|
|00000400| 2c 20 6e 69 6c 2c 20 30 | 2c 20 61 63 74 75 61 6c |, nil, 0|, actual|
|00000410| 53 69 7a 65 29 3b 0d 28 | 2a 20 6e 69 6c 20 6f 6b |Size);.(|* nil ok|
|00000420| 3a 20 6e 65 65 64 20 6f | 6e 6c 79 20 66 75 6e 63 |: need o|nly func|
|00000430| 74 69 6f 6e 20 72 65 73 | 75 6c 74 20 2a 29 0d 0d |tion res|ult *)..|
|00000440| 09 09 69 66 20 65 72 72 | 20 3d 20 65 72 72 41 45 |..if err| = errAE|
|00000450| 44 65 73 63 4e 6f 74 46 | 6f 75 6e 64 20 74 68 65 |DescNotF|ound the|
|00000460| 6e 09 09 28 2a 20 77 65 | 20 67 6f 74 20 61 6c 6c |n..(* we| got all|
|00000470| 20 74 68 65 20 72 65 71 | 75 69 72 65 64 20 70 61 | the req|uired pa|
|00000480| 72 61 6d 73 3a 20 61 6c | 6c 20 69 73 20 6f 6b 20 |rams: al|l is ok |
|00000490| 2a 29 0d 09 09 09 47 6f | 74 52 65 71 75 69 72 65 |*)....Go|tRequire|
|000004a0| 64 50 61 72 61 6d 73 20 | 3a 3d 20 6e 6f 45 72 72 |dParams |:= noErr|
|000004b0| 0d 09 09 65 6c 73 65 20 | 69 66 20 65 72 72 20 3d |...else |if err =|
|000004c0| 20 6e 6f 45 72 72 20 74 | 68 65 6e 0d 09 09 09 47 | noErr t|hen....G|
|000004d0| 6f 74 52 65 71 75 69 72 | 65 64 50 61 72 61 6d 73 |otRequir|edParams|
|000004e0| 20 3a 3d 20 65 72 72 41 | 45 45 76 65 6e 74 4e 6f | := errA|EEventNo|
|000004f0| 74 48 61 6e 64 6c 65 64 | 0d 09 09 65 6c 73 65 0d |tHandled|...else.|
|00000500| 09 09 09 47 6f 74 52 65 | 71 75 69 72 65 64 50 61 |...GotRe|quiredPa|
|00000510| 72 61 6d 73 20 3a 3d 20 | 65 72 72 3b 0d 09 65 6e |rams := |err;..en|
|00000520| 64 3b 20 28 2a 20 47 6f | 74 52 65 71 75 69 72 65 |d; (* Go|tRequire|
|00000530| 64 50 61 72 61 6d 73 20 | 2a 29 0d 0d 09 66 75 6e |dParams |*)...fun|
|00000540| 63 74 69 6f 6e 20 48 61 | 6e 64 6c 65 4f 41 50 50 |ction Ha|ndleOAPP|
|00000550| 20 28 76 61 72 20 74 68 | 65 41 70 70 6c 65 45 76 | (var th|eAppleEv|
|00000560| 65 6e 74 2c 20 72 65 70 | 6c 79 3a 20 41 70 70 6c |ent, rep|ly: Appl|
|00000570| 65 45 76 65 6e 74 3b 20 | 6f 70 65 6e 61 70 70 70 |eEvent; |openappp|
|00000580| 3a 20 70 74 72 29 3a 20 | 4f 53 45 72 72 3b 0d 28 |: ptr): |OSErr;.(|
|00000590| 2a 20 3c 61 65 76 74 3e | 20 7d 0d 7b 09 6b 43 6f |* <aevt>| }.{.kCo|
|000005a0| 72 65 45 76 65 6e 74 43 | 6c 61 73 73 20 6b 41 45 |reEventC|lass kAE|
|000005b0| 4f 70 65 6e 41 70 70 6c | 69 63 61 74 69 6f 6e 7d |OpenAppl|ication}|
|000005c0| 0d 7b 2a 29 0d 09 09 76 | 61 72 0d 09 09 09 6f 65 |.{*)...v|ar....oe|
|000005d0| 3a 20 4f 53 45 72 72 3b | 0d 09 62 65 67 69 6e 0d |: OSErr;|..begin.|
|000005e0| 09 09 72 65 70 6c 79 20 | 3a 3d 20 72 65 70 6c 79 |..reply |:= reply|
|000005f0| 3b 20 7b 20 55 6e 75 73 | 65 64 20 7d 0d 09 28 2a |; { Unus|ed }..(*|
|00000600| 20 57 65 20 64 6f 6e 27 | 74 20 65 78 70 65 63 74 | We don'|t expect|
|00000610| 20 61 6e 79 20 70 61 72 | 61 6d 73 20 61 74 20 61 | any par|ams at a|
|00000620| 6c 6c 2c 20 62 75 74 20 | 63 68 65 63 6b 20 69 6e |ll, but |check in|
|00000630| 20 63 61 73 65 20 74 68 | 65 20 63 6c 69 65 6e 74 | case th|e client|
|00000640| 20 72 65 71 75 69 72 65 | 73 20 61 6e 79 20 2a 29 | require|s any *)|
|00000650| 0d 09 09 6f 65 20 3a 3d | 20 47 6f 74 52 65 71 75 |...oe :=| GotRequ|
|00000660| 69 72 65 64 50 61 72 61 | 6d 73 28 74 68 65 41 70 |iredPara|ms(theAp|
|00000670| 70 6c 65 45 76 65 6e 74 | 29 3b 0d 09 09 6f 65 20 |pleEvent|);...oe |
|00000680| 3a 3d 20 44 6f 4f 41 70 | 70 28 6f 70 65 6e 61 70 |:= DoOAp|p(openap|
|00000690| 70 70 29 3b 0d 09 09 48 | 61 6e 64 6c 65 4f 41 50 |pp);...H|andleOAP|
|000006a0| 50 20 3a 3d 20 6f 65 3b | 0d 09 65 6e 64 3b 0d 0d |P := oe;|..end;..|
|000006b0| 09 66 75 6e 63 74 69 6f | 6e 20 48 61 6e 64 6c 65 |.functio|n Handle|
|000006c0| 44 6f 63 73 20 28 76 61 | 72 20 74 68 65 41 70 70 |Docs (va|r theApp|
|000006d0| 6c 65 45 76 65 6e 74 2c | 20 72 65 70 6c 79 3a 20 |leEvent,| reply: |
|000006e0| 41 70 70 6c 65 45 76 65 | 6e 74 3b 20 64 6f 64 6f |AppleEve|nt; dodo|
|000006f0| 63 70 3a 20 70 74 72 29 | 3a 20 4f 53 45 72 72 3b |cp: ptr)|: OSErr;|
|00000700| 0d 28 2a 20 3c 61 65 76 | 74 3e 7d 0d 7b 09 6b 43 |.(* <aev|t>}.{.kC|
|00000710| 6f 72 65 45 76 65 6e 74 | 43 6c 61 73 73 20 6b 41 |oreEvent|Class kA|
|00000720| 45 4f 70 65 6e 44 6f 63 | 75 6d 65 6e 74 73 7d 0d |EOpenDoc|uments}.|
|00000730| 7b 09 6b 43 6f 72 65 45 | 76 65 6e 74 43 6c 61 73 |{.kCoreE|ventClas|
|00000740| 73 20 6b 41 45 50 72 69 | 6e 74 44 6f 63 75 6d 65 |s kAEPri|ntDocume|
|00000750| 6e 74 73 7d 0d 7b 2a 29 | 0d 09 09 76 61 72 0d 09 |nts}.{*)|...var..|
|00000760| 09 09 6d 79 46 53 53 3a | 20 46 53 53 70 65 63 3b |..myFSS:| FSSpec;|
|00000770| 0d 09 09 09 64 6f 63 4c | 69 73 74 3a 20 41 45 44 |....docL|ist: AED|
|00000780| 65 73 63 4c 69 73 74 3b | 0d 09 09 09 69 6e 64 65 |escList;|....inde|
|00000790| 78 2c 20 69 74 65 6d 73 | 49 6e 4c 69 73 74 3a 20 |x, items|InList: |
|000007a0| 6c 6f 6e 67 69 6e 74 3b | 0d 09 09 09 61 63 74 75 |longint;|....actu|
|000007b0| 61 6c 53 69 7a 65 3a 20 | 53 69 7a 65 3b 0d 09 09 |alSize: |Size;...|
|000007c0| 09 6b 65 79 77 64 3a 20 | 41 45 4b 65 79 77 6f 72 |.keywd: |AEKeywor|
|000007d0| 64 3b 0d 09 09 09 74 79 | 70 65 43 6f 64 65 3a 20 |d;....ty|peCode: |
|000007e0| 64 65 73 63 54 79 70 65 | 3b 0d 09 09 09 6f 65 2c |descType|;....oe,|
|000007f0| 20 6f 6f 65 3a 20 4f 53 | 45 72 72 3b 0d 09 62 65 | ooe: OS|Err;..be|
|00000800| 67 69 6e 0d 09 09 72 65 | 70 6c 79 20 3a 3d 20 72 |gin...re|ply := r|
|00000810| 65 70 6c 79 3b 20 7b 20 | 55 6e 75 73 65 64 20 7d |eply; { |Unused }|
|00000820| 0d 09 09 6f 65 20 3a 3d | 20 41 45 47 65 74 50 61 |...oe :=| AEGetPa|
|00000830| 72 61 6d 44 65 73 63 28 | 74 68 65 41 70 70 6c 65 |ramDesc(|theApple|
|00000840| 45 76 65 6e 74 2c 20 6b | 65 79 44 69 72 65 63 74 |Event, k|eyDirect|
|00000850| 4f 62 6a 65 63 74 2c 20 | 74 79 70 65 41 45 4c 69 |Object, |typeAELi|
|00000860| 73 74 2c 20 64 6f 63 4c | 69 73 74 29 3b 0d 09 09 |st, docL|ist);...|
|00000870| 69 66 20 6f 65 20 3d 20 | 6e 6f 45 72 72 20 74 68 |if oe = |noErr th|
|00000880| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 6f 6f 65 20 |en begin|....ooe |
|00000890| 3a 3d 20 47 6f 74 52 65 | 71 75 69 72 65 64 50 61 |:= GotRe|quiredPa|
|000008a0| 72 61 6d 73 28 74 68 65 | 41 70 70 6c 65 45 76 65 |rams(the|AppleEve|
|000008b0| 6e 74 29 3b 0d 28 2a 20 | 6e 6f 77 20 67 65 74 20 |nt);.(* |now get |
|000008c0| 65 61 63 68 20 61 6c 69 | 61 73 20 66 72 6f 6d 20 |each ali|as from |
|000008d0| 74 68 65 20 6c 69 73 74 | 20 28 61 73 20 61 6e 20 |the list| (as an |
|000008e0| 46 53 53 53 70 65 63 29 | 20 61 6e 64 20 6f 70 65 |FSSSpec)| and ope|
|000008f0| 6e 20 74 68 65 20 61 73 | 73 6f 63 69 61 74 65 64 |n the as|sociated|
|00000900| 20 66 69 6c 65 2e 20 2a | 29 0d 09 09 09 6f 65 20 | file. *|)....oe |
|00000910| 3a 3d 20 41 45 43 6f 75 | 6e 74 49 74 65 6d 73 28 |:= AECou|ntItems(|
|00000920| 64 6f 63 4c 69 73 74 2c | 20 69 74 65 6d 73 49 6e |docList,| itemsIn|
|00000930| 4c 69 73 74 29 3b 0d 09 | 09 09 66 6f 72 20 69 6e |List);..|..for in|
|00000940| 64 65 78 20 3a 3d 20 31 | 20 74 6f 20 69 74 65 6d |dex := 1| to item|
|00000950| 73 49 6e 4c 69 73 74 20 | 64 6f 20 62 65 67 69 6e |sInList |do begin|
|00000960| 0d 09 09 09 09 6f 6f 65 | 20 3a 3d 20 41 45 47 65 |.....ooe| := AEGe|
|00000970| 74 4e 74 68 50 74 72 28 | 64 6f 63 4c 69 73 74 2c |tNthPtr(|docList,|
|00000980| 20 69 6e 64 65 78 2c 20 | 74 79 70 65 46 53 53 2c | index, |typeFSS,|
|00000990| 20 6b 65 79 77 64 2c 20 | 74 79 70 65 43 6f 64 65 | keywd, |typeCode|
|000009a0| 2c 20 40 6d 79 46 53 53 | 2c 20 73 69 7a 65 6f 66 |, @myFSS|, sizeof|
|000009b0| 28 6d 79 46 53 53 29 2c | 20 61 63 74 75 61 6c 53 |(myFSS),| actualS|
|000009c0| 69 7a 65 29 3b 0d 28 2a | 20 63 6f 65 72 63 69 6f |ize);.(*| coercio|
|000009d0| 6e 20 64 6f 65 73 20 61 | 6c 69 61 73 2d 3e 66 73 |n does a|lias->fs|
|000009e0| 73 70 65 63 20 2a 29 0d | 09 09 09 09 69 66 20 6f |spec *).|....if o|
|000009f0| 6f 65 20 3d 20 6e 6f 45 | 72 72 20 74 68 65 6e 0d |oe = noE|rr then.|
|00000a00| 09 09 09 09 09 6f 6f 65 | 20 3a 3d 20 44 6f 44 6f |.....ooe| := DoDo|
|00000a10| 63 73 28 6d 79 46 53 53 | 2c 20 64 6f 64 6f 63 70 |cs(myFSS|, dodocp|
|00000a20| 29 3b 0d 09 09 09 65 6e | 64 3b 0d 09 09 09 6f 6f |);....en|d;....oo|
|00000a30| 65 20 3a 3d 20 41 45 44 | 69 73 70 6f 73 65 44 65 |e := AED|isposeDe|
|00000a40| 73 63 28 64 6f 63 4c 69 | 73 74 29 3b 0d 09 09 65 |sc(docLi|st);...e|
|00000a50| 6e 64 3b 0d 09 09 48 61 | 6e 64 6c 65 44 6f 63 73 |nd;...Ha|ndleDocs|
|00000a60| 20 3a 3d 20 6f 65 3b 0d | 09 65 6e 64 3b 20 28 2a | := oe;.|.end; (*|
|00000a70| 20 48 61 6e 64 6c 65 44 | 6f 63 73 20 2a 29 0d 0d | HandleD|ocs *)..|
|00000a80| 09 66 75 6e 63 74 69 6f | 6e 20 48 61 6e 64 6c 65 |.functio|n Handle|
|00000a90| 51 55 49 54 20 28 76 61 | 72 20 74 68 65 41 70 70 |QUIT (va|r theApp|
|00000aa0| 6c 65 45 76 65 6e 74 2c | 20 72 65 70 6c 79 3a 20 |leEvent,| reply: |
|00000ab0| 41 70 70 6c 65 45 76 65 | 6e 74 3b 20 71 75 69 74 |AppleEve|nt; quit|
|00000ac0| 70 3a 20 70 74 72 29 3a | 20 4f 53 45 72 72 3b 0d |p: ptr):| OSErr;.|
|00000ad0| 28 2a 20 3c 61 65 76 74 | 3e 20 7d 0d 7b 09 6b 43 |(* <aevt|> }.{.kC|
|00000ae0| 6f 72 65 45 76 65 6e 74 | 43 6c 61 73 73 20 6b 41 |oreEvent|Class kA|
|00000af0| 45 51 75 69 74 41 70 70 | 6c 69 63 61 74 69 6f 6e |EQuitApp|lication|
|00000b00| 7d 0d 7b 2a 29 0d 09 09 | 76 61 72 0d 09 09 09 6f |}.{*)...|var....o|
|00000b10| 65 3a 20 4f 53 45 72 72 | 3b 0d 09 09 09 65 72 72 |e: OSErr|;....err|
|00000b20| 53 74 72 3a 20 53 74 72 | 32 35 35 3b 0d 09 62 65 |Str: Str|255;..be|
|00000b30| 67 69 6e 0d 28 2a 20 57 | 65 20 64 6f 6e 27 74 20 |gin.(* W|e don't |
|00000b40| 65 78 70 65 63 74 20 61 | 6e 79 20 70 61 72 61 6d |expect a|ny param|
|00000b50| 73 20 61 74 20 61 6c 6c | 2c 20 62 75 74 20 63 68 |s at all|, but ch|
|00000b60| 65 63 6b 20 69 6e 20 63 | 61 73 65 20 74 68 65 20 |eck in c|ase the |
|00000b70| 63 6c 69 65 6e 74 20 72 | 65 71 75 69 72 65 73 20 |client r|equires |
|00000b80| 61 6e 79 20 2a 29 0d 09 | 09 6f 65 20 3a 3d 20 47 |any *)..|.oe := G|
|00000b90| 6f 74 52 65 71 75 69 72 | 65 64 50 61 72 61 6d 73 |otRequir|edParams|
|00000ba0| 28 74 68 65 41 70 70 6c | 65 45 76 65 6e 74 29 3b |(theAppl|eEvent);|
|00000bb0| 0d 09 09 6f 65 20 3a 3d | 20 44 6f 51 75 69 74 28 |...oe :=| DoQuit(|
|00000bc0| 71 75 69 74 70 29 3b 09 | 09 09 09 28 2a 20 73 65 |quitp);.|...(* se|
|00000bd0| 74 20 67 6c 6f 62 61 6c | 20 62 6f 6f 6c 65 61 6e |t global| boolean|
|00000be0| 3a 20 61 70 70 20 77 69 | 6c 6c 20 65 78 69 74 20 |: app wi|ll exit |
|00000bf0| 61 74 20 65 6e 64 20 6f | 66 20 65 76 65 6e 74 20 |at end o|f event |
|00000c00| 6c 6f 6f 70 20 2a 29 0d | 09 09 69 66 20 72 65 70 |loop *).|..if rep|
|00000c10| 6c 79 2e 64 61 74 61 48 | 61 6e 64 6c 65 20 3c 3e |ly.dataH|andle <>|
|00000c20| 20 6e 69 6c 20 74 68 65 | 6e 09 09 28 2a 20 61 20 | nil the|n..(* a |
|00000c30| 72 65 70 6c 79 20 69 73 | 20 73 6f 75 67 68 74 20 |reply is| sought |
|00000c40| 2a 29 0d 09 09 09 62 65 | 67 69 6e 0d 09 09 09 69 |*)....be|gin....i|
|00000c50| 66 20 6f 65 20 3d 20 6e | 6f 45 72 72 20 74 68 65 |f oe = n|oErr the|
|00000c60| 6e 0d 09 09 09 09 65 72 | 72 53 74 72 20 3a 3d 20 |n.....er|rStr := |
|00000c70| 27 4f 4b 27 0d 09 09 09 | 65 6c 73 65 0d 09 09 09 |'OK'....|else....|
|00000c80| 09 65 72 72 53 74 72 20 | 3a 3d 20 27 75 73 65 72 |.errStr |:= 'user|
|00000c90| 20 63 61 6e 63 65 6c 6c | 65 64 20 71 75 69 74 27 | cancell|ed quit'|
|00000ca0| 3b 0d 09 09 09 6f 65 20 | 3a 3d 20 41 45 50 75 74 |;....oe |:= AEPut|
|00000cb0| 50 61 72 61 6d 50 74 72 | 28 72 65 70 6c 79 2c 20 |ParamPtr|(reply, |
|00000cc0| 6b 65 79 45 72 72 6f 72 | 53 74 72 69 6e 67 2c 20 |keyError|String, |
|00000cd0| 74 79 70 65 43 68 61 72 | 2c 20 50 74 72 28 40 65 |typeChar|, Ptr(@e|
|00000ce0| 72 72 53 74 72 5b 31 5d | 29 2c 20 6c 65 6e 67 74 |rrStr[1]|), lengt|
|00000cf0| 68 28 65 72 72 53 74 72 | 29 29 3b 0d 09 09 65 6e |h(errStr|));...en|
|00000d00| 64 3b 0d 09 09 48 61 6e | 64 6c 65 51 55 49 54 20 |d;...Han|dleQUIT |
|00000d10| 3a 3d 20 6f 65 3b 0d 09 | 65 6e 64 3b 0d 0d 09 66 |:= oe;..|end;...f|
|00000d20| 75 6e 63 74 69 6f 6e 20 | 49 6e 69 74 41 70 70 6c |unction |InitAppl|
|00000d30| 65 45 76 65 6e 74 73 20 | 28 44 6f 4f 41 70 70 2c |eEvents |(DoOApp,|
|00000d40| 20 44 6f 4f 44 6f 63 2c | 20 44 6f 50 72 69 6e 74 | DoODoc,| DoPrint|
|00000d50| 2c 20 44 6f 51 75 69 74 | 3a 20 50 74 72 29 3a 20 |, DoQuit|: Ptr): |
|00000d60| 4f 53 45 72 72 3b 0d 09 | 09 76 61 72 0d 09 09 09 |OSErr;..|.var....|
|00000d70| 61 65 76 74 45 72 72 3a | 20 4f 53 45 72 72 3b 0d |aevtErr:| OSErr;.|
|00000d80| 09 62 65 67 69 6e 0d 09 | 09 61 65 76 74 45 72 72 |.begin..|.aevtErr|
|00000d90| 20 3a 3d 20 6e 6f 45 72 | 72 3b 0d 09 09 69 66 20 | := noEr|r;...if |
|00000da0| 28 61 65 76 74 45 72 72 | 20 3d 20 6e 6f 45 72 72 |(aevtErr| = noErr|
|00000db0| 29 20 61 6e 64 20 28 44 | 6f 4f 41 70 70 20 3c 3e |) and (D|oOApp <>|
|00000dc0| 20 6e 69 6c 29 20 74 68 | 65 6e 0d 09 09 09 61 65 | nil) th|en....ae|
|00000dd0| 76 74 45 72 72 20 3a 3d | 20 41 45 49 6e 73 74 61 |vtErr :=| AEInsta|
|00000de0| 6c 6c 45 76 65 6e 74 48 | 61 6e 64 6c 65 72 28 6b |llEventH|andler(k|
|00000df0| 43 6f 72 65 45 76 65 6e | 74 43 6c 61 73 73 2c 20 |CoreEven|tClass, |
|00000e00| 6b 41 45 4f 70 65 6e 41 | 70 70 6c 69 63 61 74 69 |kAEOpenA|pplicati|
|00000e10| 6f 6e 2c 20 40 48 61 6e | 64 6c 65 4f 41 50 50 2c |on, @Han|dleOAPP,|
|00000e20| 20 6c 6f 6e 67 69 6e 74 | 28 44 6f 4f 41 70 70 29 | longint|(DoOApp)|
|00000e30| 2c 20 66 61 6c 73 65 29 | 3b 0d 09 09 69 66 20 28 |, false)|;...if (|
|00000e40| 61 65 76 74 45 72 72 20 | 3d 20 6e 6f 45 72 72 29 |aevtErr |= noErr)|
|00000e50| 20 61 6e 64 20 28 44 6f | 4f 44 6f 63 20 3c 3e 20 | and (Do|ODoc <> |
|00000e60| 6e 69 6c 29 20 74 68 65 | 6e 0d 09 09 09 61 65 76 |nil) the|n....aev|
|00000e70| 74 45 72 72 20 3a 3d 20 | 41 45 49 6e 73 74 61 6c |tErr := |AEInstal|
|00000e80| 6c 45 76 65 6e 74 48 61 | 6e 64 6c 65 72 28 6b 43 |lEventHa|ndler(kC|
|00000e90| 6f 72 65 45 76 65 6e 74 | 43 6c 61 73 73 2c 20 6b |oreEvent|Class, k|
|00000ea0| 41 45 4f 70 65 6e 44 6f | 63 75 6d 65 6e 74 73 2c |AEOpenDo|cuments,|
|00000eb0| 20 40 48 61 6e 64 6c 65 | 44 6f 63 73 2c 20 6c 6f | @Handle|Docs, lo|
|00000ec0| 6e 67 69 6e 74 28 44 6f | 4f 44 6f 63 29 2c 20 66 |ngint(Do|ODoc), f|
|00000ed0| 61 6c 73 65 29 3b 0d 09 | 09 69 66 20 28 61 65 76 |alse);..|.if (aev|
|00000ee0| 74 45 72 72 20 3d 20 6e | 6f 45 72 72 29 20 61 6e |tErr = n|oErr) an|
|00000ef0| 64 20 28 44 6f 50 72 69 | 6e 74 20 3c 3e 20 6e 69 |d (DoPri|nt <> ni|
|00000f00| 6c 29 20 74 68 65 6e 0d | 09 09 09 61 65 76 74 45 |l) then.|...aevtE|
|00000f10| 72 72 20 3a 3d 20 41 45 | 49 6e 73 74 61 6c 6c 45 |rr := AE|InstallE|
|00000f20| 76 65 6e 74 48 61 6e 64 | 6c 65 72 28 6b 43 6f 72 |ventHand|ler(kCor|
|00000f30| 65 45 76 65 6e 74 43 6c | 61 73 73 2c 20 6b 41 45 |eEventCl|ass, kAE|
|00000f40| 50 72 69 6e 74 44 6f 63 | 75 6d 65 6e 74 73 2c 20 |PrintDoc|uments, |
|00000f50| 40 48 61 6e 64 6c 65 44 | 6f 63 73 2c 20 6c 6f 6e |@HandleD|ocs, lon|
|00000f60| 67 69 6e 74 28 44 6f 50 | 72 69 6e 74 29 2c 20 66 |gint(DoP|rint), f|
|00000f70| 61 6c 73 65 29 3b 0d 09 | 09 69 66 20 28 61 65 76 |alse);..|.if (aev|
|00000f80| 74 45 72 72 20 3d 20 6e | 6f 45 72 72 29 20 61 6e |tErr = n|oErr) an|
|00000f90| 64 20 28 44 6f 51 75 69 | 74 20 3c 3e 20 6e 69 6c |d (DoQui|t <> nil|
|00000fa0| 29 20 74 68 65 6e 0d 09 | 09 09 61 65 76 74 45 72 |) then..|..aevtEr|
|00000fb0| 72 20 3a 3d 20 41 45 49 | 6e 73 74 61 6c 6c 45 76 |r := AEI|nstallEv|
|00000fc0| 65 6e 74 48 61 6e 64 6c | 65 72 28 6b 43 6f 72 65 |entHandl|er(kCore|
|00000fd0| 45 76 65 6e 74 43 6c 61 | 73 73 2c 20 6b 41 45 51 |EventCla|ss, kAEQ|
|00000fe0| 75 69 74 41 70 70 6c 69 | 63 61 74 69 6f 6e 2c 20 |uitAppli|cation, |
|00000ff0| 40 48 61 6e 64 6c 65 51 | 55 49 54 2c 20 6c 6f 6e |@HandleQ|UIT, lon|
|00001000| 67 69 6e 74 28 44 6f 51 | 75 69 74 29 2c 20 66 61 |gint(DoQ|uit), fa|
|00001010| 6c 73 65 29 3b 0d 09 09 | 49 6e 69 74 41 70 70 6c |lse);...|InitAppl|
|00001020| 65 45 76 65 6e 74 73 20 | 3a 3d 20 61 65 76 74 45 |eEvents |:= aevtE|
|00001030| 72 72 3b 0d 09 65 6e 64 | 3b 0d 0d 65 6e 64 2e 20 |rr;..end|;..end. |
|00001040| 28 2a 20 52 65 71 75 69 | 72 65 64 45 76 65 6e 74 |(* Requi|redEvent|
|00001050| 53 75 70 70 6f 72 74 20 | 2a 29 00 00 00 00 00 00 |Support |*)......|
|00001060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001080| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001090| 90 e4 00 03 00 00 00 0b | 90 e5 00 03 00 00 00 0b |........|........|
|000010a0| 90 e6 00 03 00 00 00 0b | 90 e7 00 03 00 00 00 0b |........|........|
|000010b0| 16 52 65 71 75 69 72 65 | 64 45 76 65 6e 74 53 75 |.Require|dEventSu|
|000010c0| 70 70 6f 72 74 2e 70 45 | 02 00 00 00 54 45 58 54 |pport.pE|....TEXT|
|000010d0| 00 00 54 45 58 54 43 57 | 49 45 00 00 02 08 00 40 |..TEXTCW|IE.....@|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 a9 f0 d6 26 00 00 | 0f da 00 00 01 9a 00 0b |.....&..|........|
|00001100| 90 f2 00 03 00 00 00 0b | 90 f3 00 03 00 00 00 0b |........|........|
|00001110| 90 f4 00 03 00 00 00 0b | 90 f5 00 03 00 00 00 0b |........|........|
|00001120| 90 f6 00 03 00 00 00 0b | 90 f7 00 03 00 00 00 0b |........|........|
|00001130| 90 f8 00 03 00 00 00 0b | 90 f9 00 03 00 00 00 0b |........|........|
|00001140| 90 fa 00 03 00 00 00 0b | 90 fb 00 03 00 00 00 0b |........|........|
|00001150| 90 fc 00 03 00 00 00 0b | 90 fd 00 03 00 00 00 0b |........|........|
|00001160| 90 fe 00 03 00 00 00 0b | 90 ff 00 03 00 00 00 0b |........|........|
|00001170| 91 00 00 03 00 00 00 04 | 91 01 00 03 00 00 00 04 |........|........|
|00001180| 00 00 00 48 00 09 47 65 | 6e 65 76 61 00 00 00 00 |...H..Ge|neva....|
|00001190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 03 | 00 02 00 52 00 09 01 d0 |........|...R....|
|000011b0| 02 68 00 52 00 09 01 d0 | 02 68 ae 16 b3 b0 00 00 |.h.R....|.h......|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 00 04 |........|........|
|000011d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000011e0| 00 00 00 46 00 5c be d4 | 13 d6 00 00 00 1c 00 46 |...F.\..|.......F|
|000011f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00001200| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00001210| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00001220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+